<?php

namespace Database\Seeders;

use App\Models\AdvertModel;
use Illuminate\Database\Seeder;

class AdvertSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $menuList = [
            [
                'name' => '服务器推荐',
                'type' => AdvertModel::TYPE_MENU,
                'jump' => AdvertModel::JUMP_OUT,
                'jump_link' => 'https://akile.io/register?aff_code=95fdc65d-5d1b-43a0-97b6-d96431960919',
                'status' => AdvertModel::STATUS_OPEN
            ],
            [
                'name' => '机场推荐',
                'type' => AdvertModel::TYPE_MENU,
                'jump' => AdvertModel::JUMP_OUT,
                'jump_link' => 'https://www.landouyun.site/#/register?code=GyuMwt4I',
                'status' => AdvertModel::STATUS_OPEN
            ]
        ];
        $noticeList = [
            [
                'name' => 'akile服务器每月8.88元',
                'type' => AdvertModel::TYPE_NOTICE,
                'jump' => AdvertModel::JUMP_OUT,
                'jump_link' => 'https://akile.io/register?aff_code=95fdc65d-5d1b-43a0-97b6-d96431960919',
                'status' => AdvertModel::STATUS_OPEN
            ],
            [
                'name' => '蓝豆云6.8元每月60G高速流量',
                'type' => AdvertModel::TYPE_NOTICE,
                'jump' => AdvertModel::JUMP_OUT,
                'jump_link' => 'https://www.landouyun.site/#/register?code=GyuMwt4I',
                'status' => AdvertModel::STATUS_OPEN
            ]
        ];

        // 批量插入数据
        $advertList = array_merge($menuList, $noticeList);
        if (!empty($advertList)) {
            AdvertModel::query()->insert($advertList);
        }
    }
}
